package com.example.es.entity;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author guoq.z
 * @date 2021/3/6
 */
@Document(indexName = "es_user", shards = 1, replicas = 0)
public class EsUser {

    @ApiModelProperty("id")
    @Id
    public String id;

    /**
     * 姓名
     */
    @ApiModelProperty("姓名")
    @Field(type = FieldType.Text, analyzer = "ik_max_word") // 使用ik分词器
    public String name;

    @ApiModelProperty("性别")
    @Field(type = FieldType.Keyword)
    public String gender;

    @ApiModelProperty("班级名称")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    public String className;

}
